Data visualisation: new best practice guidance from RSS publications

RSS International Conference 2023

Andreas Krause, Nicola Rennie, & Brian Tarran

About us

About the guide

Why visualise data?

Motivation

Principles and elements of visualisation

Slide 1

Styling charts

Discussion: what’s wrong with this chart?

05:00

{RSSthemes}

{RSSthemes} R package

  • Colour palettes

  • Base R helper functions

  • {ggplot2} helper functions

Installation

Installing from GitHub:

remotes::install_github("nrennie/RSSthemes")

Load package:

library(RSSthemes)

Example: plotting with base R

barplot(
  height = table(mtcars$gear),
  col = factor(
    unique(mtcars$gear)
    )
)

set_rss_palette("signif_qual")
barplot(
  height = table(mtcars$gear),
  col = factor(
    unique(mtcars$gear)
    )
)

Example: plotting with ggplot2}

  • {ggplot2} is an R package that provides functionality for drawing graphics.
install.packages("ggplot2")

ggplot2 hex sticker logo

{ggplot2}: basic plot

library(ggplot2)
g <- ggplot(data = mtcars) +
  geom_bar(
    mapping = aes(
      x = cyl,
      fill = factor(vs)
      )
    )
g

{ggplot2}: scales

g +
  scale_fill_rss_d("signif_qual")

{ggplot2}: theme

g +
  scale_fill_rss_d("signif_qual") +
  theme_significance()